package cn.wolfcode.car.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 预约
 */
@Setter
@Getter
@TableName("bus_appointment")
public class Appointment {
    private static final long serialVersionUID = 1L;
    public static final Integer STATUS_APPOINTMENT = 0;//预约中
    public static final Integer STATUS_ARRIVAL = 1;//已到店
    public static final Integer STATUS_CANCEL = 2;//用户取消
    public static final Integer STATUS_OVERTIME = 3;//超时取消
    public static final Integer STATUS_SETTLE  = 4;//已结算
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;
    @TableField(value = "customer_name")
    private String customerName;                    //客户姓名
    @TableField(value = "customer_phone")
    private String customerPhone;                   //客户联系方式
    @TableField(value = "appointment_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT + 8" )       //指定显示在浏览器的时间格式，否则只会显示欧美时间格式，而且不指定明确的地区时间则会出现时间差显示
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")   //指定接收时间数据格式，如果不用这个注解则出现400异常
    private Date appointmentTime;                   //预约时间
    @TableField(value = "actual_arrival_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT + 8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date actualArrivalTime;                 //实际到店时间
    @TableField(value = "license_plate")
    private String licensePlate;                    //车牌号码
    @TableField(value = "car_series")
    private String carSeries;                       //汽车类型
    @TableField(value = "service_type")
    private Integer serviceType;                    //客服务类型【维修0/保养1】
    @TableField(value = "create_time")
    private Date createTime;                        //创建时间
    @TableField(value = "info")
    private String info;                            //备注信息
    @TableField(value = "status")
    private Integer status = STATUS_APPOINTMENT;    //状态【预约中0/已到店1/用户取消2/超时取消3】
    @TableField(value = "is_del")
    private Integer is_del; //软删除

}